package tech.aistar.corejava.day08.Factory;

/**
 * Created by 李雨昂 on 2019/7/24.
 */
public class MyBeanFactory {
    public static final int V_ONE = 1;

    public static final int V_TWO = 2;

    public static final int V_THREE = 3;


    public static IUserDao getInstance(int type){
        //return new UserDaoImpl();
        IUserDao userDao = null;
        switch(type){
            case V_ONE:
                userDao = new UserDaoImpl();
                break;
            case V_TWO:
                userDao = new UserDaoImpl2();
                break;
            case V_THREE:
                userDao = new UserDaoImpl3();
                break;
        }
        return userDao;
    }
}
